// const Home = require('../src/containers/Home/index.js');
const express = require('express');
var app = express();

import Home from '../containers/Home'
import React from 'react'
import {renderToString} from 'react-dom/server';
const content = renderToString(<Home />);

// 包含客户端静态资源方法
app.use(express.static('public'));

app.get('/', function (req, res) {
    res.send(`
        <html>
            <head>
                <title>SSR服务器 - Minimal Template Sample</title>
            </head>
            <body>
                <div id="root">${content}</div>
                <script src="/index.js"></script>
            </body>
        </html>
        `)
});

app.listen(3000, function () {
    console.log('Node app start at port 3000');
});
